<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="westh.ilib.bean.surveyReport.SurveyReport;" language="java"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
	<title>${pageTitleLocal}</title>
	<link rel=stylesheet type=text/css href="ilib/style/main.css">
	<style type="text/css">
	h2{
		clear:left;
		float:left;
		margin-top:20px;
		}
	h3{
		clear:left;
		float:left;
		margin-top:10px;
		}
	h4{
		clear:left;
		float:left;
		margin-top:5px;
		}
	p{
		clear:left;
		float:left;
		width:350px;
		margin-top:5px;
		}
	form{
		clear:left;
		float:left;
		width:350px;
		}
	input{
		float:left;
		}
	span{
		margin: 1px 5px 5px 5px;
		width:90px;
		float:left;
	}
	</style>
	<script type="text/javascript">
		function check()
		{
			var resourceTypeList = document.testForm.resourceType;
			var i;
			for(i = 0; i < resourceTypeList.length; i++){
				if(resourceTypeList[i].checked == true)
					break;
			}
			if(i == resourceTypeList.length){
				alert("请选择查新类型!");
				return false;
			}
				
			if(document.testForm.surveyExpression.value.length==0){
				alert("请输入查新关键字!");
				return false;
			}
			
			var resourceFieldList = document.testForm.resourceField;
			for(i = 0; i < resourceFieldList.length; i++){
				if(resourceFieldList[i].checked == true)
					break;
			}
			if(i == resourceFieldList.length){
				alert("请选择查新域!");
				return false;
			}
			return true;
		}
	</script>
</head>

<body>
<div id="container">
	<div id="header">
		<div id="logo">
			<div><img src="ilib/images/ilib.bmp"></div>
		</div>
		<ul id="menu">
			<li><a href="../index.html">首页</a></li>
			<li><a href="../addFunction.html">添加功能块</a><img src="ilib/images/add2.gif"></li>		
			<li><a href="../myResource.html">我的资源</a></li>
			<li><a href="../option.html">设置</a></li>
			<li><a href="../logoff.html">退出</a></li>
		</ul>
	</div>

	<div id="option" style="float:left;margin-left:50px;">
		Welcome, Zhang Yanxing!		
	</div>

	<div id="clear"></div>   

    <div id="surveyReport" style="margin-left:50px;">
		<div id="subsection" style="clear: left; float: left; width: 350px;">
			<h3>查新：</h3>			
			<form name="testForm" action="http://localhost:4180/ilib/getSurveyReport.do" method="post" onSubmit="return check()" target="_blank">
			
			<h4>选择查新类型:</h4><br/>
			<p id="resourceTypeList">
				<input type="checkbox" name="resourceType" value="1"></input><span>图书</span>
				<input type="checkbox" name="resourceType" value="2"></input><span>会议论文</span>
				<input type="checkbox" name="resourceType" value="3"></input></span><span>期刊论文</span>
				<input type="checkbox" name="resourceType" value="4"></input><span>专利</span>
				<input type="checkbox" name="resourceType" value="5"></input><span>软著</span>
				<input type="checkbox" name="resourceType" value="6"></input><span>技术报告</span>
				<input type="checkbox" name="resourceType" value="7"></input><span>标准</span>				
			</p>
			
			
			<p id="keyword">			
				<h4>关键字：</h4>
				<input type="text" name="surveyExpression" dataType="Require" msg="输入串不能为空" style="margin-top:2px;" />
				<input name="submit" type="submit" value="确定"/>
			</p>	
				
			<h4>选择查新域:</h4>
			<p id="resourceFieldList">			
				<input type="checkbox" name="resourceField" value="1"></input><span>国家图书馆</span>
				<input type="checkbox" name="resourceField" value="2"></input><span>清华大学图书馆</span>
				<input type="checkbox" name="resourceField" value="3"></input><span>CALIS</span>
				<input type="checkbox" name="resourceField" value="4"></input><span>清华水利</span>
				<input type="checkbox" name="resourceField" value="5"></input><span>TagSys</span>
			</p>			
			</form>
		</div>
			
		<% SurveyReport report = (SurveyReport)request.getAttribute("report");%>
		<div id="subsection" style="clear:left; float:left; width:350px; font-size:13px;">
			<h3>查新报告:</h3>		
			<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; margin-left:50px;width:300px; float:right;" >	
			    <tr>
				    <td width="18%">共搜索到</td>
			    </tr>
			    <tr>
			      	<td></td><td width="30%">图书</td><td width="10%" style="text-align:right"><%out.print(report.getBookNum());%></td><td width="5%">本</td><td></td>
			    </tr>
			    <tr>
			      	<td></td><td>会议论文</td><td style="text-align:right"><%out.print(report.getConfNum());%></td><td>篇</td>
			    </tr>
			    <tr>
			      	<td></td><td>期刊论文</td><td style="text-align:right"><%out.print(report.getJournalNum());%></td><td>篇</td>
			    </tr>
			    <tr>
			      	<td></td><td>专利</td><td style="text-align:right"><%out.print(report.getPatentNum());%></td><td>篇</td>			      	
			    </tr>
			    <tr>
			      	<td></td><td>标准</td><td style="text-align:right"><%out.print(report.getStandardNum());%></td><td>篇</td>
			    </tr>
			    <tr>
			      	<td></td><td>软件著作权</td><td style="text-align:right"><%out.print(report.getSoftwCopyrNum());%></td><td>篇</td>
			    </tr>
			    <tr>
			      	<td></td><td>技术报告</td><td style="text-align:right"><%out.print(report.getTechReportNum());%></td><td>篇</td>
			   </tr>
		</table>
		</div>

		<div id="subsection" style="clear: left; float: left; width: 600px;">
			<h3>摘要:</h3>
			<p style="width: 720px; font-size:13px;">
			<%
				String [] sents = report.getSurveyAbstract().split("\n\r");
				for(int i = 0; i < sents.length; i++){
					out.print(sents[i]);
					out.print("</p><p style=\"width: 720px; font-size:13px;\">");
				}
			%>
			</p>
			<br/>
		</div>	
	</div>
	
	<div id="footer">
		iLib 2010
	</div>	
</div><!-- end #container -->
</body>
</html>
